#include <bits/stdc++.h>
using namespace std;
const int N = 60000 + 7;
const double eps = 1e-9;
int n;
int x[N], v[N];
bool check(double t) {
  double l = -2e9, r = 2e9;
  for (int i = 0; i < n; ++i) {
    l = max(l, x[i] - t * v[i]);
    r = min(r, x[i] + t * v[i]);
  }
  return l <= r;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i];
  for (int i = 0; i < n; ++i) cin >> v[i];
  double lo = 0, hi = 1e9 + 7;
  for (int i = 0; i < 1000; ++i) {
    // while (hi - lo > eps) {  // TLE
    double mid = (lo + hi) / 2;
    if (check(mid)) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  printf("%.9f", (hi + lo) / 2);
}

/*

TLE hack:

3
1 1000000000 2
1 2 1000000000

*/
